'''
Created on May 13, 2012

@author: Vu Dao
'''
import unittest
from Functions.globalFunc import openWebsite, getData
from Functions.loginFunc import loginWebsite
from Functions.administratorFunc import clickOnAddNewArticleBtn
from Functions.articleFunc import addNewArticle
#from selenium.webdriver.common.keys import Keys

# get test data
userName = getData().login.username
passWord = getData().login.password
articleTitle = getData().article.articleName
articleAlias = getData().article.articleAlias
articleCategory = getData().article.articleCategory
articleStatus = getData().article.status
articleAccess = getData().article.access
articleFeatured = getData().article.featured
articleLanguage = getData().article.Language
articleContent = getData().article.articleText
class Test(unittest.TestCase):


    def setUp(self):
        "Buoc 1: Mo website"
        openWebsite(self)
    def testName(self):
        "Buoc 2: Dang nhap website voi tai khoan quyen administrator"
        loginWebsite(self,userName,passWord)
        
        "Buoc 3: Click vao nut Add New Article"
        clickOnAddNewArticleBtn(self)
        
        "Buoc 4: Tao moi mot Article"
        addNewArticle(self,articleTitle, articleAlias, articleCategory, articleStatus, articleAccess, articleFeatured, articleLanguage, articleContent)
    def tearDown(self):
        pass


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()